// pages/home/home.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    name: "coder why",
    age: 20,
    students: [{
        id: 110,
        name: "shenhan",
        age: 10
      },
      {
        id: 111,
        name: "shenhan1",
        age: 101
      },
      {
        id: 112,
        name: "shenhan2",
        age: 102
      },
    ],
    count: 0
  },
  addCount() {
    // 错误做法
    // this.data.count = this.data.count + 1;
    this.setData({
      count: this.data.count + 1
    })
  },
  reduceCount() {
    this.setData({
      count: this.data.count - 1
    })
  }
})